<template>
    <div class="my-header" :style="{ color,backgroundColor:bgc }">{{title}}</div>
</template>

<script>
export default {
    props: {
        title: {
            type: String,
            required: true, //表示此参数必传，不传会报错
        },
        color: {
            type: String,
            default: '#fff', //表示此参数不传，会默认会#fff
        },
        bgc: String, //约束参数的类型
    },
}
</script>

<style lang="less" scoped>
.my-header {
    height: 45px;
    line-height: 45px;
    text-align: center;
    background-color: #1d7bff;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
}
</style>